package model;

public class MultTerm extends ElementarTerm {

	public MultTerm(String varName, String replacedPart) {
		super(varName, replacedPart);
	}

	@Override
	public void execute(VarValueList varValueList) {
		Value result = Value.mult(varValueList.getValue(var1), varValueList
				.getValue(var2));
		varValueList.setValue(eleTermId, result);
	}

	@Override
	public String toString() {
		return "Mult-Term:" + eleTermId + "=" + var1 + "*" + var2;
	}

	@Override
	public void speedExecute(SpeedVarValueList speedVarValueList) {
		speedVarValueList.setValue(eleTermId, speedVarValueList.internalMap
				.get(var1)
				* speedVarValueList.internalMap.get(var2));
	}

}
